.TH "LIGHTNING-GETLOG" "7" "" "" "lightning-getlog"
.SH NAME
lightning-getlog - Command to show logs\.
.SH SYNOPSIS

\fBgetlog\fR [\fIlevel\fR]

.SH DESCRIPTION

The \fBgetlog\fR the RPC command to show logs, with optional log \fIlevel\fR\.

.RS
.IP \[bu]
\fIlevel\fR: A string that represents the log level (\fIbroken\fR, \fIunusual\fR, \fIinfo\fR, \fIdebug\fR, or \fIio\fR)\.  The default is \fIinfo\fR\.

.RE
.SH EXAMPLE JSON REQUEST
.nf
.RS
{
  "id": 82,
  "method": "getlog",
  "params": {
    "level": "debug"
  }
}
.RE

.fi
.SH RETURN VALUE

On success, a object will be return with the following parameters:

.RS
.IP \[bu]
\fIcreated_at\fR: An floating point value that represents the UNIX timestamp when logging began\. 
.IP \[bu]
\fIbytes_used\fR: A string that represents the dimension in bytes of the log file\.
.IP \[bu]
\fIbytes_max\fR: An integer that represents the max dimension in bytes of log file\.
.IP \[bu]
\fIlog\fR: An array of objects where each element contains the following proprieties:.RS
.IP \[bu]
\fItype\fR: A string that represents the log level\. The propriety can have an value equal to SKIPPED to indicate the existence of omitted entries\.
.IP \[bu]
\fItime\fR: A floating point value that represents the time since \fIcreated_at\fR\.
.IP \[bu]
\fIsource\fR: A string that represents the source of line\.
.IP \[bu]
\fIlog\fR: A string that represents the content of line\.

.RE

.IP \[bu]
\fInum_skipped\fR: An integer that it is present only if the log level is equal to SKIPPED\.

.RE

On failure, one of the following error codes may be returned:

.RS
.IP \[bu]
-32602: Error in given parameters\.

.RE
.SH EXAMPLE JSON RESPONSE
.nf
.RS
{
   "created_at": "1598192543.820753463",
   "bytes_used": 89285843,
   "bytes_max": 104857600,
   "log": [
      {
         "type": "SKIPPED",
         "num_skipped": 45
      },
      {
         "type": "INFO",
         "time": "0.453627568",
         "source": "plugin-autopilot.py",
         "log": "RPC method 'autopilot-run-once' does not have a docstring."
      }
   ]
}
.RE

.fi
.SH AUTHOR

Vincenzo Palazzo \fI<vincenzo.palazzo@protonmail.com\fR> wrote the initial version of this man page, but many others did the hard work of actually implementing this rpc command\.

.SH RESOURCES

Main web site: \fIhttps://github.com/ElementsProject/lightning\fR

\" SHA256STAMP:789e23927120d0fefd374592a3c655244fd6c28a122368bdd8da2f3cdde66798
